A map of the two ways a game talks to the player - sound out, buttons in - and which page covers which.
A game speaks to the player through what it plays, and it listens through the buttons. This section covers both, and they are separate topics with a page each.
| You want to | Read | The short version |
|---|---|---|
| Play a song, or a jump or coin noise | Sound and music | Only one song plays at a time. Short sound effects play on top of it, and many can play at once. |
| Know when the player pressed a button | Reading the buttons | A GBA has ten buttons. You can ask if one was just pressed, is being held, or was just released. These are three different questions. |
| Have a second player on a second console | The link cable | Two GBAs joined by a link cable share their buttons, so you can ask about player 2's buttons the way you ask about your own. Only buttons cross the cable. |
A GBA has no keyboard and no mouse. Everything the player does is one of ten buttons: A, B, L, R, Start, Select, and the four directions of the d-pad. Your code asks about them once every frame, which is one picture of the game. The GBA makes about 60 a second.
The same button can mean different things in different games, so GBML also lets you give a button a name for what it does, such as "jump", and lets the player change which button that is. That is covered on the Reading the buttons page, and action_rebind is the call that changes it.
Music and sound effects are different kinds of file, and GBML treats them as different things with different functions. The Sound and music page explains why, how fades work, and how to bend a song's speed or pitch while it plays.
Both belong to the game's frame. The order of a frame shows exactly when your code reads the buttons, and Core basics covers pausing, which stops button events but lets sound keep going.